package com.example.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;

import com.example.pojo.Tuihuozhu;
import com.example.service.CgthBiz;
import com.example.vo.PageBean;

@Controller
public class CgthController { 
	@Autowired
	private CgthBiz cgthbiz;
	

	public CgthBiz getCgthbiz() {
		return cgthbiz;
	}

	public void setCgthbiz(CgthBiz cgthbiz) {
		this.cgthbiz = cgthbiz;
	}

	@RequestMapping("/cgthloady")
	@ResponseBody
	public PageBean cgthxianshi(Integer pagenum){
		
		return cgthbiz.queryPage(pagenum,1);
	}
	@RequestMapping("/cgth")
	public ModelAndView go(){
		
		return new ModelAndView("cgth");
	}
	@RequestMapping("/cgthadd")
	@ResponseBody
	public void cgthadd(@RequestBody Tuihuozhu save){
		System.out.println("进了吗");
		cgthbiz.cgthAdd(save);
	}
	@RequestMapping("/cgthdelete")
	@ResponseBody
	public void cgthdelete(String billno){
		cgthbiz.cgthDelete(billno);
	}
	@RequestMapping("/cgthupdate1")
	@ResponseBody
	public void cgthupdateshenhe(String billno){
		cgthbiz.cgthUpdateA(billno);
	}
	@RequestMapping("/cgthupdate2")
	@ResponseBody
	public void cgthupdatefanshenhe(String billno){
		cgthbiz.cgthUpdateB(billno);
	}
	/**
	 * 修改采购订单单况
	 * @param Billno
	 */
	@RequestMapping("/cgthxgdddk")
	@ResponseBody
	public void xgdddkUpdate(String Billno){
		cgthbiz.xgdddkUpdate(Billno);
	}
	/**
	 * 修改采购订单中未入库量
	 * @param Qtyremain
	 * @param Billno
	 */
	@RequestMapping("/cgthxgddwrkl")
	@ResponseBody
	public void xgddwrklUpdate(String Qtyremain,String Billno){
		cgthbiz.xgddwrklUpdate(Qtyremain, Billno);
	}
	/**
	 * 修改供应商主文件的最近退货日期
	 */
	@RequestMapping("/cgthgysdate")
	@ResponseBody
	public void xggyszjthdate(String gysname){
		cgthbiz.xggyszjdate(gysname);
	}
	@RequestMapping("/cgthxgckcounts")
	@ResponseBody
	public void xgckcount(double number,String prodId){
		//System.out.println("数量");
		cgthbiz.xgckcount(number, prodId);
	}
	@RequestMapping("/fscgthxgckcounts")
	@ResponseBody
	public void fsxgckcount(double number,String prodId){
		//System.out.println("数量");
		cgthbiz.fsxgckcount(number, prodId);
	}
	@RequestMapping("/xgthwckslUpdate")
	@ResponseBody
	public void xgthwckslUpdate(int weishengxiaosl,String billno){
		cgthbiz.xgthwckslUpdate(weishengxiaosl, billno);
	}
	@RequestMapping("/shxggyszwjxinxi")
	@ResponseBody
	public void shxggyszwjxinxi(double qimyingfuk,String GYSname){
		cgthbiz.shxggyszwjxinxi(qimyingfuk, GYSname);
	}
	@RequestMapping("/fshxggyszwjxinxi")
	@ResponseBody
	public void fshxggyszwjxinxi(double qimyingfuk,String GYSname){
		cgthbiz.fshxggyszwjxinxi(qimyingfuk, GYSname);
	}
}
